﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;

[CustomEditor(typeof(MyAgent))]
public class AgentEditor : Editor
{
    public override void OnInspectorGUI()
    {
        base.OnInspectorGUI();
        EditorGUILayout.BeginVertical();
        if (GUILayout.Button("设置目标点"))
        {
            MyAgent agent = target as MyAgent;
            agent.SetTarget(GameObject.Find("Target").transform);
        }
        EditorGUILayout.EndVertical();
    }
}
